package cn.edu.zjicm.wordsnet_d.BroadcastReceiver;

import cn.edu.zjicm.wordsnet_d.activity.ExamRunActivity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class ScreenBroadcastReceiver extends BroadcastReceiver {
	private String action;

	@Override
	public void onReceive(Context context, Intent intent) {
		action = intent.getAction();
		if (Intent.ACTION_SCREEN_ON.equals(action)) {
			Log.d("Tag", "解锁了......");
		} else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
			Log.d("Tag", "锁屏了......");
			if (((ExamRunActivity) ExamRunActivity.mContext)!=null) {
				((ExamRunActivity) ExamRunActivity.mContext).lockScreenFlag = true;
				((ExamRunActivity) ExamRunActivity.mContext).pauseTimer();
			}

		}
	}

}
